var a = getApp();

Page({
    data: {
        isLoadMore: !0,
        page: 1,
        total_page: 0
    },
    onLoad: function(a) {
        wx.setNavigationBarTitle({
            title: "绑定记录"
        });
    },
    onReady: function() {},
    onShow: function() {
        this.init(), this.getData();
    },
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        this.data.isLoadMore ? this.getMoreData() : console.log("没有更多了");
    },
    onShareAppMessage: function() {},
    init: function() {
        this.setData({
            listData: [],
            isLoadMore: !0,
            page: 1,
            total_page: 0
        });
    },
    getData: function() {
        var t = this, o = a.getNetAddresss("plugin.debt-shop.frontend.vip.bindLog");
        a._getNetWork({
            url: o,
            success: function(a) {
                var o = a.data;
                1 == o.result && (console.log(o), t.data.isLoadMore = !0, t.data.total_page = o.data.last_page, 
                t.data.total_page || (t.data.total_page = 0), t.setData({
                    listData: o.data.data
                }));
            },
            fail: function(a) {
                console.log(a);
            }
        });
    },
    getMoreData: function() {
        var t = this, o = "";
        this.data.isLoadMore = !1, this.data.page >= this.data.total_page || (this.data.page = this.data.page + 1, 
        o = a.getNetAddresss("plugin.debt-shop.frontend.vip.bindLog"), a._postNetWork({
            url: o,
            data: {
                page: this.data.page
            },
            success: function(a) {
                var o = a.data;
                1 == o.result ? (t.data.isLoadMore = !0, t.setData({
                    listData: t.data.listData.concat(o.data.data)
                })) : (t.data.page = t.data.page - 1, t.isLoadMore = !1, wx.showToast({
                    icon: "none",
                    title: o.msg,
                    duration: 1500
                }));
            },
            fail: function(a) {
                console.log(a);
            }
        }));
    }
});